\section{size --- size of argument}
\label{fn:size}
\index{size()}
\index{size of argument}
\index{matrix!dimensions}
\index{list!number of elements}
\begin{rail}
Size : 'size' '(' ( Scalar | Matrix | String | List ) ')' ;
\end{rail}

The \verb+size+ function returns the size of the argument.  If the
argument is a string or scalar, then the result is a two element
row vector, with both elements set to $1$.  If the argument is a
matrix, then the result is a two element row vector, with the first
element equal to the number of rows in the argument, and the second
argument equal to the number of columns.  If the argument is a list,
\verb+size+ returns the number of elements in the list.


\paragraph{Example}
\index{example of size()}
\index{size!example}
\begin{verbatim}
> a = 1
 a =
        1
> size(a)
        1          1  
> a = 1 +3j
 a =
        1 + 3i
> size(a)
        1          1  
> a = rand(2,4)
 a =
        1      0.647     0.0369      0.665  
    0.975      0.333      0.162     0.0847  
> size(a)
        2          4  
> size("a string")
        1          1  
> size(["a", "string", "matrix"])
        1          3  
> b = <<a; c="another string"; b = 3+4j; d = 3-4j>>
 b =
   1            b            c            d            
> size(b)
        4
\end{verbatim}

See also: Page~\pageref{fn:length} \verb+length()+,
Page~\pageref{fn:show} \verb+show()+.

\newpage


